4 a. What is the difference between FASTA and GenBank file formats, and how can you convert 
sequence data from a FASTA file into the GenBank format while preserving both the sequence and 
its annotations? 

The FASTA and GenBank file formats are both commonly used for storing sequence data in 
bioinformatics, but they differ in terms of the information they contain: 

1. FASTA Format: 

o Structure: FASTA files store only the sequence data, along with a simple header line 
(starting with a '>' symbol) that typically contains a brief identifier or description of the 
sequence. 

o Content: FASTA format includes the sequence itself (DNA, RNA, or protein), but it does 
not store detailed annotations like gene names, sequence features, or functional 
descriptions. 


2. GenBank Format: 

o Structure: GenBank files provide a much more detailed record that includes sequence 
data, annotations, and additional metadata such as gene names, product descriptions, 
sequence features (e.g., coding regions, exons), and publication references. 

o Content: GenBank format stores not only the sequence but also features such as location 
of genes, coding regions, exons, and other functional or structural annotations. This makes 
GenBank more useful for storing biologically rich sequence data. 


Conversion Process: 

To convert sequence data from a FASTA file to GenBank format, the conversion process must: 

● Read the FASTA file to extract the sequence and the description. 

● Create a SeqRecord object in Biopython, which stores both the sequence and any annotations 
(even if they are minimal). 

● Write the SeqRecord object to a GenBank file, where you can include sequence features (e.g., 
gene name, function, locations).